#ifndef SCORE_H_
#define SCORE_H_

#include "Players.h"
#include "ModelComposite.h"
#include <map>

class ScoreModel : public ModelComposite
{
public:
    ScoreModel(PlayersPtr players);
    virtual ~ScoreModel();

    void init();
    void fullRows(int playerId, int noOfRows);
    void newRow(int playerId);
    void pieceDown(int playerId);
    void declareWinner();
    void handleEvent(const Event& event);

private:
    void updateScore(int playerId, int points);
    typedef std::pair<int, Model*> ScoreData;
    typedef std::map<int, ScoreData > ScoreMap;
    ScoreMap scores;
    PlayersPtr players;
};

#endif
